import java.util.Arrays;
import java.util.List;

public class BatchTest {
    private static String determineEducationLevel(String batchName) {
        if (batchName == null || batchName.isEmpty()) {
            return "undergraduate";
        }

        String lowerBatchName = batchName.toLowerCase();

        // Check for junior college (zhuanke) first
        if (lowerBatchName.contains("专科") || 
            lowerBatchName.contains("高职") ||
            lowerBatchName.contains("专科提前批") ||
            lowerBatchName.contains("艺术类专科") ||
            lowerBatchName.contains("体育类专科") ||
            lowerBatchName.contains("体育专科") ||
            lowerBatchName.contains("艺术专科") ||
            lowerBatchName.contains("专科批")) {
            return "junior_college";
        }

        // Check for undergraduate (benke)
        if (lowerBatchName.contains("本科") ||
            lowerBatchName.contains("一批") ||
            lowerBatchName.contains("二批") ||
            lowerBatchName.contains("三批") ||
            lowerBatchName.contains("第一批") ||
            lowerBatchName.contains("第二批") ||
            lowerBatchName.contains("国家专项") ||
            lowerBatchName.contains("高校专项") ||
            lowerBatchName.contains("地方专项") ||
            lowerBatchName.contains("区域专项") ||
            lowerBatchName.contains("特殊类型") ||
            lowerBatchName.contains("艺术本科") ||
            lowerBatchName.contains("体育本科") ||
            lowerBatchName.contains("艺术类本科") ||
            lowerBatchName.contains("体育类本科") ||
            lowerBatchName.contains("本科提前") ||
            lowerBatchName.contains("提前批") ||
            lowerBatchName.contains("零批次") ||
            lowerBatchName.contains("零志愿") ||
            lowerBatchName.contains("平行录取") ||
            lowerBatchName.contains("普通类") ||
            lowerBatchName.contains("一段") ||
            lowerBatchName.contains("二段") ||
            lowerBatchName.contains("三段") ||
            lowerBatchName.contains("预科") ||
            lowerBatchName.contains("免费定向") ||
            lowerBatchName.contains("少数民族") ||
            lowerBatchName.contains("一类模式") ||
            lowerBatchName.contains("分类招生")) {
            return "undergraduate";
        }

        System.out.println("Cannot determine education level for: " + batchName + ", defaulting to undergraduate");
        return "undergraduate";
    }

    public static void main(String[] args) {
        List<String> testBatches = Arrays.asList(
            "本科批", "专科批", "本科提前批", "国家专项计划本科批", "高校专项计划本科批",
            "体育类本科批", "艺术类本科批", "专科提前批", "艺术类专科批", "本科二批", 
            "本科一批", "体育类专科批", "第一批", "艺术类第二批", "提前批", "本科三批",
            "平行录取一段", "平行录取二段", "普通类一段", "普通类二段", "零批次", "零志愿批次"
        );

        System.out.println("Batch Name Education Level Test Results:");
        System.out.println("========================================");
        
        int total = 0, undergraduate = 0, juniorCollege = 0;
        
        for (String batch : testBatches) {
            String level = determineEducationLevel(batch);
            System.out.printf("%-30s -> %s\n", batch, level);
            
            total++;
            if ("undergraduate".equals(level)) {
                undergraduate++;
            } else {
                juniorCollege++;
            }
        }
        
        System.out.println("========================================");
        System.out.printf("Total: %d batches\n", total);
        System.out.printf("Undergraduate: %d batches\n", undergraduate);
        System.out.printf("Junior College: %d batches\n", juniorCollege);
        System.out.printf("Undergraduate ratio: %.1f%%\n", (double) undergraduate / total * 100);
        System.out.printf("Junior College ratio: %.1f%%\n", (double) juniorCollege / total * 100);
    }
}
